package yang.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * PatientInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "patient_info", catalog = "hospital")
public class PatientInfo implements java.io.Serializable {

	// Fields

	private String patientId;//UUID
	private HospitalUser hospitalUser;//关联的用户
	private Integer patientTodayid;//当日的ID
	private Integer patientAge;//病人年龄
	private Timestamp patientDate;//创建时间
	private String patientName;//病人名称
	private Integer patientSex;//病人性别
	private Integer patientType;//记录流程
	private Set<ChufangInfo> chufangInfos = new HashSet<ChufangInfo>(0);

	// Constructors

	/** default constructor */
	public PatientInfo() {
	}

	/** minimal constructor */
	public PatientInfo(String patientId) {
		this.patientId = patientId;
	}

	/** full constructor */
	public PatientInfo(String patientId, HospitalUser hospitalUser,
			Integer patientTodayid, Integer patientAge, Timestamp patientDate,
			String patientName, Integer patientSex, Integer patientType,
			Set<ChufangInfo> chufangInfos) {
		this.patientId = patientId;
		this.hospitalUser = hospitalUser;
		this.patientTodayid = patientTodayid;
		this.patientAge = patientAge;
		this.patientDate = patientDate;
		this.patientName = patientName;
		this.patientSex = patientSex;
		this.patientType = patientType;
		this.chufangInfos = chufangInfos;
	}

	// Property accessors
	@Id
	@Column(name = "Patient_id", unique = true, nullable = false, length = 36)
	public String getPatientId() {
		return this.patientId;
	}

	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Patient_dactor")
	public HospitalUser getHospitalUser() {
		return this.hospitalUser;
	}

	public void setHospitalUser(HospitalUser hospitalUser) {
		this.hospitalUser = hospitalUser;
	}

	@Column(name = "patient_todayid")
	public Integer getPatientTodayid() {
		return this.patientTodayid;
	}

	public void setPatientTodayid(Integer patientTodayid) {
		this.patientTodayid = patientTodayid;
	}

	@Column(name = "Patient_age")
	public Integer getPatientAge() {
		return this.patientAge;
	}

	public void setPatientAge(Integer patientAge) {
		this.patientAge = patientAge;
	}

	@Column(name = "Patient_date", length = 19)
	public Timestamp getPatientDate() {
		return this.patientDate;
	}

	public void setPatientDate(Timestamp patientDate) {
		this.patientDate = patientDate;
	}

	@Column(name = "Patient_name", length = 200)
	public String getPatientName() {
		return this.patientName;
	}

	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}

	@Column(name = "Patient_sex")
	public Integer getPatientSex() {
		return this.patientSex;
	}

	public void setPatientSex(Integer patientSex) {
		this.patientSex = patientSex;
	}

	@Column(name = "patient_type")
	public Integer getPatientType() {
		return this.patientType;
	}

	public void setPatientType(Integer patientType) {
		this.patientType = patientType;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "patientInfo")
	public Set<ChufangInfo> getChufangInfos() {
		return this.chufangInfos;
	}

	public void setChufangInfos(Set<ChufangInfo> chufangInfos) {
		this.chufangInfos = chufangInfos;
	}

}